using System;
using System.Windows.Forms;

namespace Pegasus.Windows.Forms.Explorer
{
	/// <summary>
	/// This is the interface the the Explorer view class uses to communicate with a tree control that 
	/// appears in the left pannel of the Explorer view.
	/// </summary>
	public interface IExplorerTree 
	{
		/// <summary>
		/// Gets or sets the selected tree node.
		/// </summary>
		/// <value>The selected tree node.</value>
		ExplorerNode SelectedTreeNode
		{
			get;
			set;
		}

		/// <summary>
		/// Adds the node.
		/// </summary>
		/// <param name="node">The node.</param>
		void AddNode( ExplorerNode node );

		/// <summary>
		/// Removes the node.
		/// </summary>
		/// <param name="node">The node.</param>
		void RemoveNode( ExplorerNode node );

		/// <summary>
		/// Removes the node children.
		/// </summary>
		/// <param name="parentNode">The parent node.</param>
		void RemoveNodeChildren( ExplorerNode parentNode );

		/// <summary>
		/// Gets the node by key.
		/// </summary>
		/// <param name="key">The key.</param>
		/// <returns>The explorer node or null if the node is not found.</returns>
		ExplorerNode GetNodeByKey( string key );

		/// <summary>
		/// Gets the node by path.
		/// </summary>
		/// <param name="path">The path.</param>
		/// <returns>The explorer node or null if the node is not found.</returns>
		ExplorerNode GetNodeByPath( string path );

		/// <summary>
		/// Sets the image list for the icons in the tree.
		/// </summary>
		/// <param name="imageList">The image list.</param>
		void SetImageList( ImageList imageList );

		/// <summary>
		/// Occurs after the tree node is selected.
		/// </summary>
		event EventHandler<ExplorerEventArgs> AfterSelect;
	}
}
